<?php

namespace App\Http\Controllers\Api\Hotel;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Facades\Services\SundrieService;

class SundrieController extends Controller
{
	public function getSundrie(Request $request){

		$rules = [
			'id' => 'required'
		];

		$this->validate($request,$rules);

		return formatJsonResponse(SundrieService::getSundrie($request->all()));
	}

	public function getSundries(Request $request){

		return formatJsonResponse(SundrieService::getSundries($request->all()));
	}

	public function createSundrie(Request $request){
		$rules = [
    		'sundrie_name' => 'required'
    	];

    	$this->validate($request,$rules);

    	SundrieService::createSundrie($request->all());

    	return formatJsonResponse();
	}

	public function updateSundrie(Request $request){

		$rules = [
			'id' => 'required',
			'sundrie_name' => 'required'
		];

		$this->validate($request,$rules);

		SundrieService::updateSundrie($request->all());

		return formatJsonResponse();
	}

	public function deleteSundrie(Request $request){

		$rules = [
			'id' => 'required'
		];

		$this->validate($request,$rules);

		SundrieService::deleteSundrie($request->all());

		return formatJsonResponse();
	}
}
